#include<iostream>
#include<algorithm>
#include<cmath>

using namespace std;
long long A[100010];

int main(){
	int n;
	long long p;
	freopen("input2.txt","r",stdin);
	cin>>n>>p;
	
	for(int i=0;i<n;i++){
		long long temp;
		cin>>temp;
		A[i]=temp;
	}
	sort(A,A+n);
	long long ans=0;
	for(int i=0;i<n;i++){
		long long left=i+ans,right=n-1;
		long long mid;
		while(left<=right){
			mid=(left+right+1)>>1;
			if(A[mid]<=A[i]*p){
				left=mid+1;
				ans=max(ans,mid-i+1);
			}else{
				right=mid-1;
			}
		}

	}

	cout<<ans<<endl;
}